package com.hhh.springai_test.model.enums;

public enum GenderEnum {
    MALE(0, "男"),
    FEMALE(1, "女");

    private Integer code;
    private String desc;

    GenderEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static String getDescByCode(Integer code) {
        for (GenderEnum genderEnum : GenderEnum.values()) {
            if (genderEnum.getCode().equals(code)) {
                return genderEnum.getDesc();
            }
        }
        return null;
    }
}
